package com.mall.common.exception;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 系统异常类
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class SysException extends RuntimeException {
    private static final long serialVersionUID = 1L;

    /**
     * 错误码
     */
    private Integer code;

    /**
     * 错误信息
     */
    private String message;

    public SysException() {
        super();
    }

    public SysException(String message) {
        super(message);
        this.message = message;
    }

    public SysException(Integer code, String message) {
        super(message);
        this.code = code;
        this.message = message;
    }

    public SysException(Integer code, String message, Throwable cause) {
        super(message, cause);
        this.code = code;
        this.message = message;
    }
}